package com.ambow.shop.domain;

/**
 * 项目。
 * 
 * @author deng.zhao
 *
 */
public abstract class LineItem {
	// 产品；
	private Product product;
	// 数量；
	private Integer quantity;

	public LineItem() {
		super();
	}

	public LineItem(Product product, Integer quantity) {
		this.product = product;
		this.quantity = quantity;
	}

	public Product getProduct() {
		return product;
	}

	public void setProduct(Product product) {
		this.product = product;
	}

	public Integer getQuantity() {
		return quantity;
	}

	public void setQuantity(Integer quantity) {
		this.quantity = quantity;
	}

	/**
	 * 获取小计。
	 * 
	 * @return 小计；
	 */
	public Double getSubtotal() {
		return product.getPrice() * getQuantity();
	}

}